var guang1 = document.getElementById("guang1");
var defaultTop = parseInt(window.getComputedStyle(guang1).getPropertyValue('top'));

var guang2 = document.getElementById("guang2");

var defaultTop2 = parseInt(window.getComputedStyle(guang2).getPropertyValue('top'));

window.addEventListener('scroll', function () {
    var scrollDistance = window.pageYOffset;

    var newTop = defaultTop + scrollDistance;
    guang1.style.top = newTop + 'px';
    var newTop2 = defaultTop2 + scrollDistance;
    guang2.style.top = newTop2 + 'px';
});

var guang3 = document.getElementById("guang3");

function showAd() {
    guang3.classList.add("show");
}
setTimeout(showAd,1500);


function gtie1() {
    guang1.style.left = "-100%"; 

    setTimeout(function () {
        guang1.style.display = "none"; 
    });
}

function gtie2() {
    guang2.style.right = "-100%"; 
    setTimeout(function () {
        guang2.style.display = "none"; 
    });
}

function gtie3() {
    guang3.classList.add("move");
    guang3.style.bottom = "-100%"; 
    setTimeout(function () {
        guang3.style.display = "none"; 
    },2000); 
}